<template>
  <div class="app-container" style="background-color: white;">
    <!-- <div style="background-color: white;" > -->
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="合同名称" prop="contractName">
        <el-input
          v-model="queryParams.contractName"
          placeholder="请输入合同名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合同类型" prop="contractType">
        <el-select v-model="queryParams.contractType" placeholder="请选择合同类型" clearable>
          <el-option
            v-for="dict in dict.type.contract_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <!-- <el-form-item label="所属部门id" prop="orgId">
        <el-input
          v-model="queryParams.orgId"
          placeholder="请输入所属部门id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="甲方姓名" prop="partyAName">
        <el-input
          v-model="queryParams.partyAName"
          placeholder="请输入甲方姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="甲方社会信用代码" prop="partyASocialCreditCode">
        <el-input
          v-model="queryParams.partyASocialCreditCode"
          placeholder="请输入甲方社会信用代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="甲方身份证号码" prop="partyAIdCardNo">
        <el-input
          v-model="queryParams.partyAIdCardNo"
          placeholder="请输入甲方身份证号码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="甲方法定代表人" prop="partyALegalPersonName">
        <el-input
          v-model="queryParams.partyALegalPersonName"
          placeholder="请输入甲方法定代表人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="甲方法人身份证号" prop="partyALegalPersonIdCardNo">
        <el-input
          v-model="queryParams.partyALegalPersonIdCardNo"
          placeholder="请输入甲方法人身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="甲方联系地址" prop="partyAContactAddress">
        <el-input
          v-model="queryParams.partyAContactAddress"
          placeholder="请输入甲方联系地址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="甲方联系电话" prop="partyAContactPhone">
        <el-input
          v-model="queryParams.partyAContactPhone"
          placeholder="请输入甲方联系电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="乙方姓名" prop="partyBName">
        <el-input
          v-model="queryParams.partyBName"
          placeholder="请输入乙方姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="乙方社会信用代码" prop="partyBSocialCreditCode">
        <el-input
          v-model="queryParams.partyBSocialCreditCode"
          placeholder="请输入乙方社会信用代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="乙方身份证号码" prop="partyBIdCardNo">
        <el-input
          v-model="queryParams.partyBIdCardNo"
          placeholder="请输入乙方身份证号码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="乙方法定代表人" prop="partyBLegalPersonName">
        <el-input
          v-model="queryParams.partyBLegalPersonName"
          placeholder="请输入乙方法定代表人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="乙方法人身份证号" prop="partyBLegalPersonIdCardNo">
        <el-input
          v-model="queryParams.partyBLegalPersonIdCardNo"
          placeholder="请输入乙方法人身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="乙方联系地址" prop="partyBContactAddress">
        <el-input
          v-model="queryParams.partyBContactAddress"
          placeholder="请输入乙方联系地址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="乙方联系电话" prop="partyBContactPhone">
        <el-input
          v-model="queryParams.partyBContactPhone"
          placeholder="请输入乙方联系电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="土地用途" prop="landPurpose">
        <el-input
          v-model="queryParams.landPurpose"
          placeholder="请输入土地用途"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="土地流转价格" prop="landCirculationPrice">
        <el-input
          v-model="queryParams.landCirculationPrice"
          placeholder="请输入土地流转价格"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="土地流转期限" prop="landCirculationTerm">
        <el-input
          v-model="queryParams.landCirculationTerm"
          placeholder="请输入土地流转期限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地流转数量" prop="landCirculationAmount">
        <el-input
          v-model="queryParams.landCirculationAmount"
          placeholder="请输入土地流转数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="开始时间" prop="startTime">
        <el-date-picker clearable
          v-model="queryParams.startTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择开始时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="结束时间" prop="endTime">
        <el-date-picker clearable
          v-model="queryParams.endTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择结束时间">
        </el-date-picker>
      </el-form-item>
      <!-- <el-form-item label="土地所在区" prop="landCounty">
        <el-input
          v-model="queryParams.landCounty"
          placeholder="请输入土地所在区"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地所在街道" prop="landStreet">
        <el-input
          v-model="queryParams.landStreet"
          placeholder="请输入土地所在街道"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地所在村" prop="landVillage">
        <el-input
          v-model="queryParams.landVillage"
          placeholder="请输入土地所在村"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地所在组" prop="landGroup">
        <el-input
          v-model="queryParams.landGroup"
          placeholder="请输入土地所在组"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="创建用户" prop="createUser">
        <el-input
          v-model="queryParams.createUser"
          placeholder="请输入创建用户"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="交付日期" prop="deliveryTime">
        <el-date-picker clearable
          v-model="queryParams.deliveryTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择交付日期">
        </el-date-picker>
      </el-form-item> -->
      <!-- <el-form-item label="甲方签字代表" prop="partyASignName">
        <el-input
          v-model="queryParams.partyASignName"
          placeholder="请输入甲方签字代表"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="甲方签字时间" prop="partyASignTime">
        <el-date-picker clearable
          v-model="queryParams.partyASignTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择甲方签字时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="甲方签字地点" prop="partyASignPlace">
        <el-input
          v-model="queryParams.partyASignPlace"
          placeholder="请输入甲方签字地点"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="乙方签字代表" prop="partyBSignName">
        <el-input
          v-model="queryParams.partyBSignName"
          placeholder="请输入乙方签字代表"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="乙方签字时间" prop="partyBSignTime">
        <el-date-picker clearable
          v-model="queryParams.partyBSignTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择乙方签字时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="乙方签字地点" prop="partyBSignPlace">
        <el-input
          v-model="queryParams.partyBSignPlace"
          placeholder="请输入乙方签字地点"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地东边边界" prop="landEastBorder">
        <el-input
          v-model="queryParams.landEastBorder"
          placeholder="请输入土地东边边界"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地西边边界" prop="landWestBorder">
        <el-input
          v-model="queryParams.landWestBorder"
          placeholder="请输入土地西边边界"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地南边边界" prop="landSouthBorder">
        <el-input
          v-model="queryParams.landSouthBorder"
          placeholder="请输入土地南边边界"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地北边边界" prop="landNorthBorder">
        <el-input
          v-model="queryParams.landNorthBorder"
          placeholder="请输入土地北边边界"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="土地/房屋单价,小写，阿拉伯数字" prop="priceStandardUnitPriceLower">
        <el-input
          v-model="queryParams.priceStandardUnitPriceLower"
          placeholder="请输入土地/房屋单价,小写，阿拉伯数字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地/房屋单价,大写，汉字" prop="priceStandardUnitPriceUpper">
        <el-input
          v-model="queryParams.priceStandardUnitPriceUpper"
          placeholder="请输入土地/房屋单价,大写，汉字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="土地/房屋总价,小写，阿拉伯数字" prop="priceStandardTotalPriceLower">
        <el-input
          v-model="queryParams.priceStandardTotalPriceLower"
          placeholder="请输入土地/房屋总价,小写，阿拉伯数字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="土地/房屋总价,大写，汉字" prop="priceStandardTotalPriceUpper">
        <el-input
          v-model="queryParams.priceStandardTotalPriceUpper"
          placeholder="请输入土地/房屋总价,大写，汉字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="其它定价调整周期" prop="priceStandardOtherAdjustCycle">
        <el-input
          v-model="queryParams.priceStandardOtherAdjustCycle"
          placeholder="请输入其它定价调整周期"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="其它定价调整方式" prop="priceStandardOthreAdjustWay">
        <el-input
          v-model="queryParams.priceStandardOthreAdjustWay"
          placeholder="请输入其它定价调整方式"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="一次性付款的付款期限" prop="payMethodSingleTerm">
        <el-date-picker clearable
          v-model="queryParams.payMethodSingleTerm"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择一次性付款的付款期限">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="一次性付款金额，小写，阿拉伯数字" prop="payMethodSinglePriceLower">
        <el-input
          v-model="queryParams.payMethodSinglePriceLower"
          placeholder="请输入一次性付款金额，小写，阿拉伯数字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="一次性付款金额，大写，汉字" prop="payMethodSinglePriceUpper">
        <el-input
          v-model="queryParams.payMethodSinglePriceUpper"
          placeholder="请输入一次性付款金额，大写，汉字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按月分期付款金额，小写，阿拉伯数字" prop="payMethodInstallmentMonthLower">
        <el-input
          v-model="queryParams.payMethodInstallmentMonthLower"
          placeholder="请输入按月分期付款金额，小写，阿拉伯数字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按月分期付款金额，大写，汉字" prop="payMethodInstallmentMonthUpper">
        <el-input
          v-model="queryParams.payMethodInstallmentMonthUpper"
          placeholder="请输入按月分期付款金额，大写，汉字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="按月分期付款的付款时间" prop="payMethodInstallmentMonthTime">
        <el-input
          v-model="queryParams.payMethodInstallmentMonthTime"
          placeholder="请输入按月分期付款的付款时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按季度分期付款金额，小写，阿拉伯数字" prop="payMethodInstallmentQuarterLower">
        <el-input
          v-model="queryParams.payMethodInstallmentQuarterLower"
          placeholder="请输入按季度分期付款金额，小写，阿拉伯数字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按季度分期付款金额，大写，汉字" prop="payMethodInstallmentQuarterUpper">
        <el-input
          v-model="queryParams.payMethodInstallmentQuarterUpper"
          placeholder="请输入按季度分期付款金额，大写，汉字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按季度分期付款的付款时间" prop="payMethodInstallmentQuarterTime">
        <el-input
          v-model="queryParams.payMethodInstallmentQuarterTime"
          placeholder="请输入按季度分期付款的付款时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按年分期付款金额，小写，阿拉伯数字" prop="payMethodInstallmentYearLower">
        <el-input
          v-model="queryParams.payMethodInstallmentYearLower"
          placeholder="请输入按年分期付款金额，小写，阿拉伯数字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按年分期付款金额，大写，汉字" prop="payMethodInstallmentYearUpper">
        <el-input
          v-model="queryParams.payMethodInstallmentYearUpper"
          placeholder="请输入按年分期付款金额，大写，汉字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按年分期付款的付款时间" prop="payMethodInstallmentYearTime">
        <el-input
          v-model="queryParams.payMethodInstallmentYearTime"
          placeholder="请输入按年分期付款的付款时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="银行卡支付，甲方账户名称" prop="payWayBankCardName">
        <el-input
          v-model="queryParams.payWayBankCardName"
          placeholder="请输入银行卡支付，甲方账户名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="银行卡支付，银行卡卡号" prop="payWayBankCardId">
        <el-input
          v-model="queryParams.payWayBankCardId"
          placeholder="请输入银行卡支付，银行卡卡号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="银行卡支付，开户行名称" prop="payWayBankOpeningBank">
        <el-input
          v-model="queryParams.payWayBankOpeningBank"
          placeholder="请输入银行卡支付，开户行名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['contract:contract:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['contract:contract:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['contract:contract:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['contract:contract:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="contractList" @selection-change="handleSelectionChange"   :height="tableHeight" border>
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="合同编号" align="center" prop="contractNo" min-width="270"/>
      <el-table-column label="合同名称" align="center" prop="contractName" min-width="250" />
      <el-table-column label="合同类型" align="center" prop="contractType" min-width="210">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.contract_type" :value="scope.row.contractType"/>
        </template>
      </el-table-column>
      <el-table-column label="所属部门" align="center" prop="orgId" min-width="120" />
      <el-table-column label="甲方姓名" align="center" prop="partyAName" min-width="80"/>
      <el-table-column label="甲方社会信用代码" align="center" prop="partyASocialCreditCode" min-width="150"/>
      <el-table-column label="甲方身份证号码" align="center" prop="partyAIdCardNo" min-width="180" />
      <el-table-column label="甲方法定代表人" align="center" prop="partyALegalPersonName" min-width="80" />
      <el-table-column label="甲方法人身份证号" align="center" prop="partyALegalPersonIdCardNo" min-width="180" />
      <el-table-column label="甲方联系地址" align="center" prop="partyAContactAddress" min-width="200" />
      <el-table-column label="甲方联系电话" align="center" prop="partyAContactPhone" min-width="120"/>
      <el-table-column label="甲方经营主体类型" align="center" prop="partyAManageType" min-width="100" />
      <el-table-column label="乙方姓名" align="center" prop="partyBName"  min-width="80"/>
      <el-table-column label="乙方社会信用代码" align="center" prop="partyBSocialCreditCode" min-width="150" />
      <el-table-column label="乙方身份证号码" align="center" prop="partyBIdCardNo" min-width="180" />
      <el-table-column label="乙方法定代表人" align="center" prop="partyBLegalPersonName" min-width="80" />
      <el-table-column label="乙方法人身份证号" align="center" prop="partyBLegalPersonIdCardNo" min-width="180" />
      <el-table-column label="乙方联系地址" align="center" prop="partyBContactAddress" min-width="200"/>
      <el-table-column label="乙方联系电话" align="center" prop="partyBContactPhone" min-width="120" />
      <el-table-column label="乙方经营主体类型" align="center" prop="partyBManageType"  min-width="120" />
      <el-table-column label="土地用途" align="center" prop="landPurpose" min-width="120" />
      <el-table-column label="土地流转价格" align="center" prop="landCirculationPrice" min-width="120" />
      <el-table-column label="土地流转类型" align="center" prop="landCirculationType"  min-width="120"/>
      <el-table-column label="土地流转期限" align="center" prop="landCirculationTerm" min-width="120" />
      <el-table-column label="土地流转数量" align="center" prop="landCirculationAmount" min-width="120" />
      <el-table-column label="开始时间" align="center" prop="startTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结束时间" align="center" prop="endTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="土地所在区" align="center" prop="landCounty" min-width="120" />
      <el-table-column label="土地所在街道" align="center" prop="landStreet" min-width="120" />
      <el-table-column label="土地所在村" align="center" prop="landVillage" min-width="120" />
      <el-table-column label="土地所在组" align="center" prop="landGroup" min-width="120"/>
      <el-table-column label="创建用户" align="center" prop="createUser" min-width="120" />
      <el-table-column label="交付日期" align="center" prop="deliveryTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="甲方签字代表" align="center" prop="partyASignName" min-width="120" />
      <el-table-column label="甲方签字时间" align="center" prop="partyASignTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.partyASignTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="甲方签字地点" align="center" prop="partyASignPlace" />
      <el-table-column label="乙方签字代表" align="center" prop="partyBSignName" />
      <el-table-column label="乙方签字时间" align="center" prop="partyBSignTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.partyBSignTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="乙方签字地点" align="center" prop="partyBSignPlace" />
      <!-- <el-table-column label="土地东边边界" align="center" prop="landEastBorder" /> -->
      <!-- <el-table-column label="土地西边边界" align="center" prop="landWestBorder" /> -->
      <!-- <el-table-column label="土地南边边界" align="center" prop="landSouthBorder" /> -->
      <!-- <el-table-column label="土地北边边界" align="center" prop="landNorthBorder" /> -->
      <!-- <el-table-column label="土地/房屋单价,小写，阿拉伯数字" align="center" prop="priceStandardUnitPriceLower" /> -->
      <!-- <el-table-column label="土地/房屋单价,大写，汉字" align="center" prop="priceStandardUnitPriceUpper" /> -->
      <!-- <el-table-column label="土地/房屋总价,小写，阿拉伯数字" align="center" prop="priceStandardTotalPriceLower" /> -->
      <!-- <el-table-column label="土地/房屋总价,大写，汉字" align="center" prop="priceStandardTotalPriceUpper" /> -->
      <!-- <el-table-column label="其它定价方式" align="center" prop="priceStandardOther" /> -->
      <!-- <el-table-column label="其它定价调整周期" align="center" prop="priceStandardOtherAdjustCycle" /> -->
      <!-- <el-table-column label="其它定价调整方式" align="center" prop="priceStandardOthreAdjustWay" /> -->
      <!-- <el-table-column label="一次性付款的付款期限" align="center" prop="payMethodSingleTerm" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.payMethodSingleTerm, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column> -->
      <!-- <el-table-column label="一次性付款金额，小写，阿拉伯数字" align="center" prop="payMethodSinglePriceLower" />
      <el-table-column label="一次性付款金额，大写，汉字" align="center" prop="payMethodSinglePriceUpper" />
      <el-table-column label="按月分期付款金额，小写，阿拉伯数字" align="center" prop="payMethodInstallmentMonthLower" />
      <el-table-column label="按月分期付款金额，大写，汉字" align="center" prop="payMethodInstallmentMonthUpper" />
      <el-table-column label="按月分期付款的付款时间" align="center" prop="payMethodInstallmentMonthTime" />
      <el-table-column label="按季度分期付款金额，小写，阿拉伯数字" align="center" prop="payMethodInstallmentQuarterLower" />
      <el-table-column label="按季度分期付款金额，大写，汉字" align="center" prop="payMethodInstallmentQuarterUpper" />
      <el-table-column label="按季度分期付款的付款时间" align="center" prop="payMethodInstallmentQuarterTime" />
      <el-table-column label="按年分期付款金额，小写，阿拉伯数字" align="center" prop="payMethodInstallmentYearLower" />
      <el-table-column label="按年分期付款金额，大写，汉字" align="center" prop="payMethodInstallmentYearUpper" />
      <el-table-column label="按年分期付款的付款时间" align="center" prop="payMethodInstallmentYearTime" /> -->
      <!-- <el-table-column label="按其它方式付款" align="center" prop="payMethodOther" /> -->
      <!-- <el-table-column label="是否是现金支付" align="center" prop="payWayIsCash" /> -->
      <!-- <el-table-column label="银行卡支付，甲方账户名称" align="center" prop="payWayBankCardName" /> -->
      <!-- <el-table-column label="银行卡支付，银行卡卡号" align="center" prop="payWayBankCardId" /> -->
      <!-- <el-table-column label="银行卡支付，开户行名称" align="center" prop="payWayBankOpeningBank" /> -->
      <el-table-column label="其它支付方式" align="center" prop="payWayOther" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleView(scope.row)"
            v-hasPermi="['contract:contract:edit']"
          >查看</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['contract:contract:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['contract:contract:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改contract对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
        <el-form-item label="合同类型" prop="contractType">
          <el-select v-model="form.contractType" placeholder="请选择合同类型">
            <el-option
              v-for="dict in dict.type.contract_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="合同名称" prop="contractName">
          <el-input v-model="form.contractName" placeholder="请输入合同名称" />
        </el-form-item>
        <!-- <el-form-item label="所属部门id" prop="orgId">
          <el-input v-model="form.orgId" placeholder="请输入所属部门id" />
        </el-form-item> -->
        <el-form-item label="甲方姓名" prop="partyAName">
          <el-input v-model="form.partyAName" placeholder="请输入甲方姓名" />
        </el-form-item>
        <el-form-item label="甲方社会信用代码" prop="partyASocialCreditCode">
          <el-input v-model="form.partyASocialCreditCode" placeholder="请输入甲方社会信用代码" />
        </el-form-item>
        <el-form-item label="甲方身份证号码" prop="partyAIdCardNo">
          <el-input v-model="form.partyAIdCardNo" placeholder="请输入甲方身份证号码" />
        </el-form-item>
        <el-form-item label="甲方法定代表人" prop="partyALegalPersonName">
          <el-input v-model="form.partyALegalPersonName" placeholder="请输入甲方法定代表人" />
        </el-form-item>
        <el-form-item label="甲方法人身份证号" prop="partyALegalPersonIdCardNo">
          <el-input v-model="form.partyALegalPersonIdCardNo" placeholder="请输入甲方法人身份证号" />
        </el-form-item>
        <el-form-item label="甲方联系地址" prop="partyAContactAddress">
          <el-input v-model="form.partyAContactAddress" placeholder="请输入甲方联系地址" />
        </el-form-item>
        <el-form-item label="甲方联系电话" prop="partyAContactPhone">
          <el-input v-model="form.partyAContactPhone" placeholder="请输入甲方联系电话" />
        </el-form-item>
        <el-form-item label="乙方姓名" prop="partyBName">
          <el-input v-model="form.partyBName" placeholder="请输入乙方姓名" />
        </el-form-item>
        <el-form-item label="乙方社会信用代码" prop="partyBSocialCreditCode">
          <el-input v-model="form.partyBSocialCreditCode" placeholder="请输入乙方社会信用代码" />
        </el-form-item>
        <el-form-item label="乙方身份证号码" prop="partyBIdCardNo">
          <el-input v-model="form.partyBIdCardNo" placeholder="请输入乙方身份证号码" />
        </el-form-item>
        <el-form-item label="乙方法定代表人" prop="partyBLegalPersonName">
          <el-input v-model="form.partyBLegalPersonName" placeholder="请输入乙方法定代表人" />
        </el-form-item>
        <el-form-item label="乙方法人身份证号" prop="partyBLegalPersonIdCardNo">
          <el-input v-model="form.partyBLegalPersonIdCardNo" placeholder="请输入乙方法人身份证号" />
        </el-form-item>
        <el-form-item label="乙方联系地址" prop="partyBContactAddress">
          <el-input v-model="form.partyBContactAddress" placeholder="请输入乙方联系地址" />
        </el-form-item>
        <el-form-item label="乙方联系电话" prop="partyBContactPhone">
          <el-input v-model="form.partyBContactPhone" placeholder="请输入乙方联系电话" />
        </el-form-item>
        <el-form-item label="土地用途" prop="landPurpose">
          <el-input v-model="form.landPurpose" placeholder="请输入土地用途" />
        </el-form-item>
        <el-form-item label="土地流转价格（元）" prop="landCirculationPrice">
          <el-input-number v-model="form.landCirculationPrice"  />
        </el-form-item>
        <el-form-item label="土地流转期限（年）" prop="landCirculationTerm">
          <el-input-number v-model="form.landCirculationTerm"  />
        </el-form-item>
        <el-form-item label="土地流转数量（亩）" prop="landCirculationAmount">
          <el-input-number v-model="form.landCirculationAmount"  />
        </el-form-item>
        <el-form-item label="合同开始时间" prop="startTime">
          <el-date-picker clearable
            v-model="form.startTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择合同开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="合同结束时间" prop="endTime">
          <el-date-picker clearable
            v-model="form.endTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择合同结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="区（县）" prop="landCounty">
          <el-input v-model="form.landCounty" placeholder="请输入土地所在区" />
        </el-form-item>
        <el-form-item label="街道（乡镇）" prop="landStreet">
          <el-input v-model="form.landStreet" placeholder="请输入土地所在街道" />
        </el-form-item>
        <el-form-item label="村" prop="landVillage">
          <el-input v-model="form.landVillage" placeholder="请输入土地所在村" />
        </el-form-item>
        <el-form-item label="组" prop="landGroup">
          <el-input v-model="form.landGroup" placeholder="请输入土地所在组" />
        </el-form-item>
        <!-- <el-form-item label="创建用户" prop="createUser">
          <el-input v-model="form.createUser" placeholder="请输入创建用户" />
        </el-form-item> -->
        <el-form-item label="交付日期" prop="deliveryTime">
          <el-date-picker clearable
            v-model="form.deliveryTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择交付日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="甲方签字代表" prop="partyASignName">
          <el-input v-model="form.partyASignName" placeholder="请输入甲方签字代表" />
        </el-form-item>
        <el-form-item label="甲方签字时间" prop="partyASignTime">
          <el-date-picker clearable
            v-model="form.partyASignTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择甲方签字时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="甲方签字地点" prop="partyASignPlace">
          <el-input v-model="form.partyASignPlace" placeholder="请输入甲方签字地点" />
        </el-form-item>
        <el-form-item label="乙方签字代表" prop="partyBSignName">
          <el-input v-model="form.partyBSignName" placeholder="请输入乙方签字代表" />
        </el-form-item>
        <el-form-item label="乙方签字时间" prop="partyBSignTime">
          <el-date-picker clearable
            v-model="form.partyBSignTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择乙方签字时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="乙方签字地点" prop="partyBSignPlace">
          <el-input v-model="form.partyBSignPlace" placeholder="请输入乙方签字地点" />
        </el-form-item>
        <el-form-item label="土地东边边界" prop="landEastBorder">
          <el-input v-model="form.landEastBorder" placeholder="请输入土地东边边界" />
        </el-form-item>
        <el-form-item label="土地西边边界" prop="landWestBorder">
          <el-input v-model="form.landWestBorder" placeholder="请输入土地西边边界" />
        </el-form-item>
        <el-form-item label="土地南边边界" prop="landSouthBorder">
          <el-input v-model="form.landSouthBorder" placeholder="请输入土地南边边界" />
        </el-form-item>
        <el-form-item label="土地北边边界" prop="landNorthBorder">
          <el-input v-model="form.landNorthBorder" placeholder="请输入土地北边边界" />
        </el-form-item>
        <!-- <el-form-item label="土地/房屋单价(元)" prop="priceStandardUnitPriceLower" >
          <el-input-number v-model="form.priceStandardUnitPriceLower" />
          <span class="upperPrice">{{ form.priceStandardUnitPriceUpper }}</span>
        </el-form-item> -->
        <!-- <el-form-item label="土地/房屋单价,大写，汉字" prop="priceStandardUnitPriceUpper">
          <el-input v-model="form.priceStandardUnitPriceUpper" placeholder="请输入土地/房屋单价,大写，汉字" />
        </el-form-item> -->
        <el-form-item label="土地/房屋总价(元)" prop="priceStandardTotalPriceLower">
          <el-input-number v-model="form.priceStandardTotalPriceLower"  />
          <span class="upperPrice">{{ form.priceStandardTotalPriceUpper }}</span>
        </el-form-item>
        <el-form-item label="价款标准">
          <el-radio v-model="form.priceStandard" label="1">现金</el-radio>
          <el-radio v-model="form.priceStandard" label="2">实物或实物折资计价</el-radio>
          <el-radio v-model="form.priceStandard" label="3">其它</el-radio>
        </el-form-item>
        <el-form-item v-if="form.priceStandard == '1'" label="每亩每年人民币（元）">
            <el-input-number v-model="form.priceStandardUnitPriceLower"></el-input-number>
            <span class="upperPrice">{{ form.priceStandardUnitPriceUpper }}</span>
        </el-form-item>
        <!-- <el-form-item label="土地/房屋总价,大写，汉字" prop="priceStandardTotalPriceUpper">
          <el-input v-model="form.priceStandardTotalPriceUpper" placeholder="请输入土地/房屋总价,大写，汉字" />
        </el-form-item> -->
        <el-form-item label="其它定价方式" prop="priceStandardOther" v-if="form.priceStandard == '3'">
          <el-input v-model="form.priceStandardOther" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="调整周期（年）" prop="priceStandardOtherAdjustCycle" v-if="form.priceStandard == '3'">
          <el-input-number v-model="form.priceStandardOtherAdjustCycle"  />
        </el-form-item>
        <el-form-item label="其它定价调整方式" prop="priceStandardOthreAdjustWay" v-if="form.priceStandard == '3'">
          <el-input v-model="form.priceStandardOthreAdjustWay" placeholder="具体调整方式" />
        </el-form-item>
        <el-form-item label="支付方式">
          <el-radio v-model="form.payMethod" label="1">一次性支付</el-radio>
          <el-radio v-model="form.payMethod" label="2">分期支付</el-radio>
          <el-radio v-model="form.payMethod" label="3">其它</el-radio>
        </el-form-item>
        <el-form-item label="付款期限" prop="payMethodSingleTerm" v-if="form.payMethod == '1'">
          <el-date-picker clearable
            v-model="form.payMethodSingleTerm"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="付款期限">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="付款金额(元)" prop="payMethodSinglePriceLower" v-if="form.payMethod == '1'">
          <el-input-number v-model="form.payMethodSinglePriceLower" placeholder="请输入一次性付款金额，小写，阿拉伯数字" />
          <span class="upperPrice">{{ form.payMethodSinglePriceUpper }}</span>
        </el-form-item>
        <el-form-item label="分期类别" v-if="form.payMethod == '2'" >
          <el-radio v-model="form.payMethodInstallmentTime" label="1">按月分期</el-radio>
          <el-radio v-model="form.payMethodInstallmentTime" label="2">按季度分期</el-radio>
          <el-radio v-model="form.payMethodInstallmentTime" label="3">按年分期</el-radio>
        </el-form-item>
        <!-- <el-form-item label="一次性付款金额，大写，汉字" prop="payMethodSinglePriceUpper">
          <el-input v-model="form.payMethodSinglePriceUpper" placeholder="请输入一次性付款金额，大写，汉字" />
        </el-form-item> -->
        <el-form-item label="按月分期付款金额" prop="payMethodInstallmentMonthLower" v-if="form.payMethodInstallmentTime == '1' && form.payMethod == '2'">
          <el-input-number v-model="form.payMethodInstallmentMonthLower" placeholder="请输入按月分期付款金额，小写，阿拉伯数字" />
          <span class="upperPrice">{{ form.payMethodInstallmentMonthUpper }}</span>
        </el-form-item>
        <!-- <el-form-item label="按月分期付款金额，大写，汉字" prop="payMethodInstallmentMonthUpper">
          <el-input v-model="form.payMethodInstallmentMonthUpper" placeholder="请输入按月分期付款金额，大写，汉字" />
        </el-form-item> -->
        <!-- <el-form-item label="按月分期付款的付款时间" prop="payMethodInstallmentMonthTime" v-if="form.payMethodInstallmentTime == '1'">
          <el-date-picker clearable
            v-model="form.payMethodInstallmentMonthTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="付款期限">
          </el-date-picker>
        </el-form-item> -->
        <el-form-item label="按季度分期付款金额" prop="payMethodInstallmentQuarterLower" v-if="form.payMethodInstallmentTime == '2' && form.payMethod == '2'">
          <el-input-number v-model="form.payMethodInstallmentQuarterLower" placeholder="请输入按季度分期付款金额，小写，阿拉伯数字" />
          <span class="upperPrice">{{ form.payMethodInstallmentQuarterUpper }}</span>
        </el-form-item>
        <!-- <el-form-item label="按季度分期付款金额，大写，汉字" prop="payMethodInstallmentQuarterUpper">
          <el-input v-model="form.payMethodInstallmentQuarterUpper" placeholder="请输入按季度分期付款金额，大写，汉字" />
        </el-form-item> -->
        <!-- <el-form-item label="按季度分期付款的付款时间" prop="payMethodInstallmentQuarterTime" v-if="form.payMethodInstallmentTime == '2' && form.payMethod == '2'">
          <el-date-picker clearable
            v-model="form.payMethodInstallmentQuarterTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="付款期限">
          </el-date-picker>
        </el-form-item> -->
        <el-form-item label="按年分期付款金额" prop="payMethodInstallmentYearLower" v-if="form.payMethodInstallmentTime == '3' && form.payMethod == '2'">
          <el-input-number v-model="form.payMethodInstallmentYearLower" placeholder="请输入按年分期付款金额，小写，阿拉伯数字" />
          <span class="upperPrice">{{ form.payMethodInstallmentYearUpper }}</span>
        </el-form-item>
        <!-- <el-form-item label="按年分期付款金额，大写，汉字" prop="payMethodInstallmentYearUpper">
          <el-input v-model="form.payMethodInstallmentYearUpper" placeholder="请输入按年分期付款金额，大写，汉字" />
        </el-form-item> -->
        <!-- <el-form-item label="按年分期付款的付款时间" prop="payMethodInstallmentYearTime" v-if="form.payMethodInstallmentTime == '3' && form.payMethod == '2'">
          <el-date-picker clearable
            v-model="form.payMethodInstallmentYearTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="付款期限">
          </el-date-picker>
        </el-form-item> -->
        <el-form-item label="按其它方式付款" prop="payMethodOther" v-if="form.payMethod == '3'">
          <el-input v-model="form.payMethodOther" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="付款类别"  >
          <el-radio v-model="form.payWay" label="1">现金</el-radio>
          <el-radio v-model="form.payWay" label="2">银行汇款</el-radio>
          <el-radio v-model="form.payWay" label="3">其它</el-radio>
        </el-form-item>
        <el-form-item label="甲方账户名称" prop="payWayBankCardName" v-if="form.payWay == '2'">
          <el-input v-model="form.payWayBankCardName" placeholder="请输入银行卡支付，甲方账户名称" />
        </el-form-item>
        <el-form-item label="银行卡卡号" prop="payWayBankCardId" v-if="form.payWay == '2'" >
          <el-input v-model="form.payWayBankCardId" placeholder="请输入银行卡支付，银行卡卡号" />
        </el-form-item>
        <el-form-item label="开户行名称" prop="payWayBankOpeningBank" v-if="form.payWay == '2'">
          <el-input v-model="form.payWayBankOpeningBank" placeholder="请输入银行卡支付，开户行名称" />
        </el-form-item>
        <el-form-item label="其它支付方式" prop="payWayOther" v-if="form.payWay == '3'">
          <el-input v-model="form.payWayOther" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>


    <el-drawer
        :visible.sync="drawerShow"
        :size="'85%'">
        <span slot="title" style="font-size: 16px;font-family: 'Arial Rounded MT Bold'">
                <i class="el-icon-view">&nbsp;合同详情</i>
            </span>
        <el-tabs type="border-card">
                    <el-tab-pane label="基本信息" >
                      <el-header style="height: 70px;line-height:70px;">
                                <div style="width:100%;text-align: center">
                                    <span style="font-family: PingFang SC;color:dimgray;font-size: 30px;cursor:pointer;
                                                font-weight:bold;vertical-align: middle;margin-bottom: 10px">
                                               <h2>西安市农村产权交易合同</h2>
                                    </span>
                                    <span style="float: right;">
                                        <!--<button v-print="printTest">打印</button>-->
                                        <!--<i class="el-icon-printer" v-print="printTest">打印</i>-->
                                    </span>
                                </div>
                            </el-header>
                            <div>
                              <table cellspacing="0" style="width: 100%;height: 100%;text-align: center;color:rgb(80,80,50)" border-collapse="collapse" >
                                    <tr style="height: 40px;width: 100%;">
                                          <td width="10%" style="height: 40px;">
                                              行政区域
                                          </td>
                                          <td width="10%"  class="inner">
                                              新城区
                                          </td>
                                          <td width="15%" style="height: 40px;">
                                              合同名称
                                          </td>
                                          <td width="30%;" colspan="2"  class="inner">
                                              {{ info.contractName }}
                                          </td>
                                          <td width="10%;">
                                            合同编号
                                          </td>
                                          <td width="25%" class="inner">
                                            {{ info.contractNo }}
                                          </td>
                                    </tr>
                                    <!-- <tr style="border:1px  solid #999;height: 40px;">
                                        <td style="border:1px  solid #999;" widith="10%">
                                          年龄
                                        </td>
                                        <td style="border:1px  solid #999;" width="10%">
                                          18
                                        </td>
                                        <td style="border:1px  solid #999;"  width="10%" >
                                          工作地点
                                        </td>
                                        <td style="border:1px  solid #999;"  width="10%">
                                          四季山水酒店
                                        </td>
                                        <td style="border:1px  solid #999;"  width="10%">
                                          所在公司
                                        </td>
                                        <td style="border:1px  solid #999;"  width="50%">
                                          天科电子
                                        </td>
                                    </tr> -->
                                    <tr style="height: 40px;">
                                        <td  rowspan="3" >
                                        甲方信息</td>
                                        
                                        <!-- <td  colspan="5"> -->
                                          <!-- <div style="width: 100%;float:left"> -->
                                            <!-- <table  cellspacing="0"> -->
                                              <!-- <tr style="height: 45px;width: 100%;"> -->
                                                <td   style="border-right:1px  solid #999;">姓名</td>
                                                <td   class="inner" style="border-right:1px  solid #999;">{{ info.partyAName }}</td>
                                                <td >身份证号</td>
                                                <td  class="inner">{{ info.partyAIdCardNo }}</td>
                                                <td >联系电话</td>
                                                <td  class="inner">{{ info.partyAContactPhone }}</td>
                                              <!-- </tr> -->
                                              <!-- <tr> -->
                                                <!-- <td  style="border-bottom:1px  solid #999;border-top:1px  solid #999;border-right:1px  solid #999;">社会信用代码</td>
                                                <td >110101199001011234</td>
                                                <td >法定代表人</td>
                                                <td >胡歌</td>
                                                <td >法定身份证号</td> -->
                                                <!-- <td width="25%">610522199310023030</td> -->
                                              <!-- </tr> -->
                                              <!-- <tr> -->
                                                <!-- <td width="15%" style="border-bottom:1px  solid #999;border-right:1px  solid #999;">联系电话</td>
                                                <td width="85%">110101199001011234</td> -->
                                              <!-- </tr> -->

                                            <!-- </table> -->
                                        <!-- </div> -->
                                        <!-- </td>  -->
                                      
                                    </tr>
                                    <tr style="height: 40px">
                                   
                                                <td  >社会信用代码</td>
                                                <td  class="inner">{{ info.partyASocialCreditCode }}</td>
                                                <td >法定代表人</td>
                                                <td  class="inner">{{ info.partyALegalPersonName }}</td>
                                                <td >法定身份证号</td>
                                                <td class="inner">{{ info.partyALegalPersonIdCardNo }}</td>
                                    </tr>

                                    <tr style="height: 40px">
                                   
                                         <td  >联系地址</td>
                                          <td  class="inner">{{ info.partyAContactAddress }}</td>
                                          <td >联系电话</td>
                                          <td  class="inner">{{ info.partyAContactPhone }}</td>
                                          <td >经营主体类型</td>
                                          <td  class="inner">{{ info.partyAManageType }}</td>
                                     </tr>


                                     <tr style="height: 40px;">
                                        <td  rowspan="3" >
                                        乙方信息</td>
                              
                                                <td   style="border-right:1px  solid #999;">姓名</td>
                                                <td   class="inner" style="border-right:1px  solid #999;">{{ info.partyBName }}</td>
                                                <td >身份证号</td>
                                                <td  class="inner">{{ info.partyBIdCardNo }}</td>
                                                <td >联系电话</td>
                                                <td  class="inner">{{ info.partyBContactPhone }}</td>
                                       
                                      
                                    </tr>
                                    <tr style="height: 40px">
                                   
                                                <td>社会信用代码</td>
                                                <td  class="inner">{{ info.partyBSocialCreditCode }}</td>
                                                <td >法定代表人</td>
                                                <td  class="inner">{{ info.partyBLegalPersonName }}</td>
                                                <td >法定身份证号</td>
                                                <td  class="inner">{{ info.partyBLegalPersonIdCardNo }}</td>
                                    </tr>

                                    <tr style="height: 40px">
                                   
                                         <td  >联系地址</td>
                                          <td  class="inner">{{ info.partyBContactAddress }}</td>
                                          <td >联系电话</td>
                                          <td  class="inner">{{ info.partyBContactPhone }}</td>
                                          <td >经营主体类型</td>
                                          <td class="inner">{{ info.partyBManageType }}</td>
                                     </tr>
                              </table>
                            </div>
                    </el-tab-pane>
                    <el-tab-pane label="详细信息">
                      <el-form label-width="110px" size="mini" :model="info" disabled >
                      <el-card class="box-card" shadow="never">
                        <div slot="header" class="clearfix" style="background:#EEEEEE;">
                            <el-row type="flex" class="row-bg">
                                <el-col :span="16">
                                    <span style="padding-left: 15px;font-size: 18px;"><i class="el-icon-info" style="color:#3a8ee6;"></i>&nbsp;&nbsp;流转信息</span>
                                </el-col>
                            </el-row>
                        </div>
                        <el-row type="flex" class="row-bg">
                            <el-col :span="10">
                                <el-form-item label="土地用途">
                                    <el-input  style="color:red" v-model="info.landPurpose"></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="6" :offset="1">
                                <el-form-item label="流转价格（元）">
                                    <el-input v-model="info.landCirculationPrice"></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="6" :offset="1">
                                <el-form-item label="流转数量（亩）">
                                    <el-input v-model="info.landCirculationAmount"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                      </el-card>


                      <el-card class="box-card my-card" shadow="never">
                        <div slot="header" class="clearfix" style="background:#EEEEEE;">
                            <el-row type="flex" class="row-bg">
                                <el-col :span="16">
                                    <span style="padding-left: 15px;font-size: 18px;"><i class="el-icon-info" style="color:#3a8ee6;"></i>&nbsp;&nbsp;时间信息</span>
                                </el-col>
                            </el-row>  
                        </div>

                        <el-row type="flex" class="row-bg">
                            <el-col :span="6">
                                <el-form-item label="合同开始时间">
                                    <el-input v-model="info.startTime"></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="6">
                                <el-form-item label="合同结束时间">
                                    <el-input v-model="info.endTime"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row type="flex" class="row-bg">

                          <el-col :span="6">
                                <el-form-item label="甲方签字代表">
                                    <el-input v-model="info.partyASignName"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="甲方签订时间">
                                    <el-input v-model="info.partyASignTime"></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="6">
                                <el-form-item label="甲方签订地点">
                                    <el-input v-model="info.partyASignPlace"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row type="flex" class="row-bg">
                          <el-col :span="6">
                                <el-form-item label="乙方签字代表">
                                    <el-input v-model="info.partyBSignName"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="乙方签订时间">
                                    <el-input v-model="info.partyBSignTime"></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="6">
                                <el-form-item label="乙方签订地点">
                                    <el-input v-model="info.partyBSignPlace"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                      </el-card>

                      <el-card class="box-card my-card" shadow="never">
                        <div slot="header" class="clearfix" style="background:#EEEEEE;">
                            <el-row type="flex" class="row-bg">
                                <el-col :span="16">
                                    <span style="padding-left: 15px;font-size: 18px;"><i class="el-icon-info" style="color:#3a8ee6;"></i>&nbsp;&nbsp;价款标准</span>
                                </el-col>
                            </el-row>
                        </div>

                        <el-row type="flex" class="row-bg">
                                <el-col :span="12">
                                    <el-form-item label="价款标准">
                                        <el-radio v-model="info.priceStandard" label="1">现金</el-radio>
                                        <el-radio v-model="info.priceStandard" label="2">实物或实物折资计价</el-radio>
                                        <el-radio v-model="info.priceStandard" label="3">其它</el-radio>
                                    </el-form-item>
                                </el-col>
                        </el-row>

                        <el-row type="flex" class="row-bg" v-if="info.priceStandard == '1'">
                                <el-col :span="6">
                                    <el-form-item label="单价（元/年）">
                                       <el-input v-model="info.priceStandardUnitPriceLower"></el-input>
                                    </el-form-item>
                                </el-col>
                        </el-row>

                        <el-row type="flex" class="row-bg" v-if="info.priceStandard == '3'">
                                <el-col :span="12">
                                    <el-form-item label="其它定价方式">
                                       <el-input v-model="info.priceStandardOther"></el-input>
                                    </el-form-item>
                                </el-col>
                        </el-row>
                        <el-row type="flex" class="row-bg" v-if="info.priceStandard == '3'">
                                <el-col :span="6">
                                    <el-form-item label="调整周期（年）">
                                       <el-input v-model="info.priceStandardOtherAdjustCycle"></el-input>
                                    </el-form-item>
                                </el-col>
                        </el-row>
                        <el-row type="flex" class="row-bg" v-if="info.priceStandard == '3'">
                                <el-col :span="12">
                                    <el-form-item label="调整方式">
                                       <el-input v-model="info.priceStandardOthreAdjustWay"></el-input>
                                    </el-form-item>
                                </el-col>
                        </el-row>

                      </el-card>


                      <el-card class="box-card my-card" shadow="never">
                        <div slot="header" class="clearfix" style="background:#EEEEEE;">
                            <el-row type="flex" class="row-bg">
                                <el-col :span="16">
                                    <span style="padding-left: 15px;font-size: 18px;"><i class="el-icon-info" style="color:#3a8ee6;"></i>&nbsp;&nbsp;价款支付方式</span>
                                </el-col>
                            </el-row>
                        </div>

                        <el-row type="flex" class="row-bg">
                                <el-col :span="12">
                                    <el-form-item label="付款方式">
                                        <el-radio v-model="info.payMethod" label="1">一次性支付</el-radio>
                                        <el-radio v-model="info.payMethod" label="2">分期支付</el-radio>
                                        <el-radio v-model="info.payMethod" label="3">其它</el-radio>
                                    </el-form-item>
                                </el-col>
                        </el-row>


                        <el-row type="flex" class="row-bg" v-if="info.payMethod == '1'">
                                <el-col :span="6">
                                    <el-form-item label="付款期限">
                                       <el-input v-model="info.payMethodSingleTerm" ></el-input>
                                    </el-form-item>
                                </el-col>

                                <el-col :span="6" :offset="1">
                                    <el-form-item label="付款金额（元）">
                                       <el-input v-model="info.payMethodSinglePriceLower" ></el-input>
                                    </el-form-item>
                                </el-col>
                        </el-row>

                        <el-row type="flex" class="row-bg" v-if="info.payMethod == '3'">
                                <el-col :span="12">
                                    <el-form-item label="其它">
                                       <el-input v-model="info.payMethodOther" ></el-input>
                                    </el-form-item>
                                </el-col>

                            
                        </el-row>

                        <el-row type="flex" class="row-bg" v-if="info.payMethod == '2'">
                                <el-col :span="12">
                                    <el-form-item label="分期类别">
                                        <el-radio v-model="info.payMethodCycle" label="1">按月分期</el-radio>
                                        <el-radio v-model="info.payMethodCycle" label="2">按季度分期</el-radio>
                                        <el-radio v-model="info.payMethodCycle" label="3">按年分期</el-radio>
                                    </el-form-item>
                                </el-col>
                        </el-row>

                        <el-row type="flex" class="row-bg" v-if="info.payMethod == '2'">
                                <el-col :span="6" v-if="info.payMethodCycle == '1'">
                                    <el-form-item label="月度分期金额">
                                        <el-input v-model="info.payMethodInstallmentMonthLower"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" v-if="info.payMethodCycle == '2'">
                                    <el-form-item label="月度分期金额">
                                        <el-input v-model="info.payMethodInstallmentQuarterLower"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" v-if="info.payMethodCycle == '3'">
                                    <el-form-item label="月度分期金额">
                                        <el-input v-model="info.payMethodInstallmentYearLower"></el-input>
                                    </el-form-item>
                                </el-col>
                        </el-row>

                      </el-card>


                      <el-card class="box-card my-card" shadow="never">
                        <div slot="header" class="clearfix" style="background:#EEEEEE;">
                            <el-row type="flex" class="row-bg">
                                <el-col :span="16">
                                    <span style="padding-left: 15px;font-size: 18px;"><i class="el-icon-info" style="color:#3a8ee6;"></i>&nbsp;&nbsp;付款方式</span>
                                </el-col>
                            </el-row>

                        </div>

                        <el-row type="flex" class="row-bg">
                                <el-col :span="12">
                                    <el-form-item label="付款方式">
                                        <el-radio v-model="info.payWay" label="1">现金</el-radio>
                                        <el-radio v-model="info.payWay" label="2">银行汇款</el-radio>
                                        <el-radio v-model="info.payWay" label="3">其它</el-radio>
                                    </el-form-item>
                                </el-col>
                        </el-row>
                        <el-row type="flex" class="row-bg" v-if="info.payWay == '2'">
                                <el-col :span="6">
                                    <el-form-item label="账户名称">
                                       <el-input v-model="info.payWayBankCardName"></el-input>
                                    </el-form-item>
                                </el-col>

                                <el-col :span="6">
                                    <el-form-item label="银行卡号">
                                       <el-input v-model="info.payWayBankCardId"></el-input>
                                    </el-form-item>
                                </el-col>

                                <el-col :span="6">
                                    <el-form-item label="开户行名称">
                                       <el-input v-model="info.payWayBankOpeningBank"></el-input>
                                    </el-form-item>
                                </el-col>
                        </el-row>


                        <el-row type="flex" class="row-bg" v-if="info.payWay == '3'">
                                <el-col :span="12">
                                    <el-form-item label="其它">
                                       <el-input v-model="info.payWayOther"></el-input>
                                    </el-form-item>
                                </el-col>
                        </el-row>

                      </el-card>



                      <el-card class="box-card my-card" shadow="never">
                        <div slot="header" class="clearfix" style="background:#EEEEEE;">
                            <el-row type="flex" class="row-bg">
                                <el-col :span="16">
                                    <span style="padding-left: 15px;font-size: 18px;"><i class="el-icon-info" style="color:#3a8ee6;"></i>&nbsp;&nbsp;其它</span>
                                </el-col>
                            </el-row>
                        </div>
                      </el-card>





                     </el-form>
                    </el-tab-pane>
                    <el-tab-pane label="合同原件">
                      <el-row type="flex" justify="end">
                            <el-button type="primary" @click="addContact" icon="el-icon-plus" size="mini" >上  传</el-button>
                        </el-row>
                        <el-table
                                :data="fileData"
                                size="mini"
                                style="width: 100%"
                                :row-style="{height:'30'}"
                                :cell-style="{padding:'0',height:'50px'}"
                                :header-cell-style="{background:'#fafafa',height:'40px',padding:'0'}">
                            <el-table-column label="序号" type="index" width="60" align="center" fixed></el-table-column>
                            <el-table-column  label="附件名称" prop="contractName" align="center" min-width="140" fixed></el-table-column>
                            <el-table-column  label="附件大小（KB)" prop="fileSize" align="center" min-width="240" fixed>
                              <template slot-scope="scope">
                                {{ formatFileSize(scope.row.fileSize) }}
                              </template>
                            </el-table-column>
                            <el-table-column label="上传日期" prop="createDate" align="center" min-width="240" fixed></el-table-column>
                            <el-table-column  label="操作" prop="status" min-width="140" align="center" fixed="right">
                                <template slot-scope="scope">
                                    <el-dropdown>
                                        <el-button type="primary" size="mini">
                                            功  能<i class="el-icon-arrow-down el-icon--right"></i>
                                        </el-button>
                                        <el-dropdown-menu slot="dropdown">
                                            <el-dropdown-item divided @click.native="handleDowload(scope.row,scope.index)" >下  载</el-dropdown-item>
                                            <el-dropdown-item divided @click.native="handleViewPDF(scope.row,scope.index)" >预  览</el-dropdown-item>
                                            <!-- <el-dropdown-item divided @click.native="hadnleDeleteDoc(scope.row,scope.index)" >删  除</el-dropdown-item> -->
                                        </el-dropdown-menu>
                                    </el-dropdown>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-tab-pane>
        </el-tabs>
    </el-drawer>

     <!--上传附件窗口-->
     <el-dialog
                    lock-scroll
                    :modal-append-to-body="false"
                    :append-to-body="true"
                    title="上传合同附件"
                    :visible.sync="uploadShow"
                    v-loading="mainLoading"
                    element-loading-text="拼命上传中，请耐心等待。。。" 
                     element-loading-spinner="el-icon-loading" 
                    element-loading-background="rgba(0, 0, 0, 0.8)"
                    width="30%">
                <el-form ref="formUpload" :model="formUpload" label-width="80px">
                    <el-form-item label="附件名称" prop="fileType" size="mini">
                        <el-input  v-model="formUpload.name"></el-input>
                    </el-form-item>
                    <el-form-item label="合同文件" prop="expandTitle">
                      <!--  -->
                        <el-upload
                                class="upload-demo"
                                ref="upload"
                                :action="doAction"
                                :data="uploadData"
                                :headers="uploadHeaders"
                                :before-upload="beforeAvatarUpload"
                                name="file"
                                :file-list="fileList"
                                :multiple="multiple"
                                :on-success="uploadSuccess"
                                :auto-upload="false">
                            <el-button slot="trigger" size="mini" type="primary">选取文件</el-button>
                        </el-upload>
                    </el-form-item>

                    <div align="center">
                        <el-form-item>
                            <el-button style="margin-left: 10px;" type="primary" @click="submitUpload">上 传</el-button>
                            <el-button @click="uploadShow = false">关 闭</el-button>
                        </el-form-item>
                    </div>
                </el-form>
            </el-dialog>


  </div>
</template>

<script>
import { listContract, getContract, delContract, addContract, updateContract,getContractFile,downloadContractFile } from "@/api/system/contract";
import { mapGetters } from "vuex";
import { getToken } from '@/utils/auth'
import {download} from '@/utils/request'

export default {
  name: "Contract",
  dicts: ['contract_type'],
  data() {
     //校验身份证码(18位)
     var validateIdCard =(rule, value, callback) =>{
        if (value === '') {
          callback(new Error('请输入身份证号码'));
        } else {
          // 验证身份证码
          if (this.validateIdCardNo(value)) {
            console.log('身份证码校验通过')
            callback();
          } else {
            callback(new Error('身份证号码格式错误'));
            this.$message.error('身份证号码格式错误');
          }
        }

      }
      // 校验手机号
      var validatePhone =(rule, value, callback) =>{
        if (value === '') {
          callback(new Error('请输入手机号'));
        } else {
          // 验证手机号
          if (this.validatePhoneNo(value)) {
            console.log('手机号校验通过')
            callback();
          } else {
            callback(new Error('手机号格式错误'));
            this.$message.error('手机号格式错误');
          }
        }
      }

    return {
      tabsStyle:{
                    height: '',
                    overflow:"scroll",
                    width:'100%',
                   
                },
      //合同附件表格对象
      fileData:[],
      mainLoading:false,
      doAction:  'http://localhost/dev-api/contract/contract/uploadContract',
      //是否打开上传附件的窗口
      uploadShow: false,
      formUpload: {
            name: '',
      },
      uploadData: {
            docName: '',
            uploadMan: 'zhaoyun',//上传人
            hireCode: 'sws',
            // contractNo: '228',
            contractNo: '998'
      },
      fileList: [],
      //请求头携带当前用户的token
      uploadHeaders:'',
       //是否打开抽屉
      drawerShow: false,
      // table高度
      tableHeight:'',
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // contract表格数据
      contractList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        contractName: null,
        contractType: null,
        orgId: null,
        partyAName: null,
        partyASocialCreditCode: null,
        partyAIdCardNo: null,
        partyALegalPersonName: null,
        partyALegalPersonIdCardNo: null,
        partyAContactAddress: null,
        partyAContactPhone: null,
        partyAManageType: null,
        partyBName: null,
        partyBSocialCreditCode: null,
        partyBIdCardNo: null,
        partyBLegalPersonName: null,
        partyBLegalPersonIdCardNo: null,
        partyBContactAddress: null,
        partyBContactPhone: null,
        partyBManageType: null,
        landPurpose: null,
        landCirculationPrice: null,
        landCirculationType: null,
        landCirculationTerm: null,
        landCirculationAmount: null,
        startTime: null,
        endTime: null,
        landCounty: null,
        landStreet: null,
        landVillage: null,
        landGroup: null,
        createUser: null,
        deliveryTime: null,
        partyASignName: null,
        partyASignTime: null,
        partyASignPlace: null,
        partyBSignName: null,
        partyBSignTime: null,
        partyBSignPlace: null,
        landEastBorder: null,
        landWestBorder: null,
        landSouthBorder: null,
        landNorthBorder: null,
        priceStandardUnitPriceLower: null,
        priceStandardUnitPriceUpper: null,
        priceStandardTotalPriceLower: null,
        priceStandardTotalPriceUpper: null,
        priceStandardOther: null,
        priceStandardOtherAdjustCycle: null,
        priceStandardOthreAdjustWay: null,
        payMethodSingleTerm: null,
        payMethodSinglePriceLower: null,
        payMethodSinglePriceUpper: null,
        payMethodInstallmentMonthLower: null,
        payMethodInstallmentMonthUpper: null,
        payMethodInstallmentMonthTime: null,
        payMethodInstallmentQuarterLower: null,
        payMethodInstallmentQuarterUpper: null,
        payMethodInstallmentQuarterTime: null,
        payMethodInstallmentYearLower: null,
        payMethodInstallmentYearUpper: null,
        payMethodInstallmentYearTime: null,
        payMethodOther: null,
        payWayIsCash: null,
        payWayBankCardName: null,
        payWayBankCardId: null,
        payWayBankOpeningBank: null,
        payWayOther: null
      },
      //详细信息
      info:{},
     
      
      // 表单参数
      form: {
        priceStandard : '',
        //支付方式
        payMethod: '',
      },
      // 表单校验
      rules: {
        id: [
          { required: true, message: "主键id不能为空", trigger: "blur" }
        ],
        contractName: [
          { required: true, message: "合同名称不能为空", trigger: "blur" }
        ],
        contractType: [
          { required: true, message: "合同类型不能为空", trigger: "change" }
        ],
        partyAName: [
          { required: true, message: "甲方姓名不能为空", trigger: "blur" }
        ],
      
        partyAIdCardNo: [
          { required: true, message: "甲方身份证号码格式错误", trigger: "blur",validator: validateIdCard }
        ],
        partyBIdCardNo: [
          { required: true, message: "乙方身份证号码格式错误", trigger: "blur",validator: validateIdCard }
        ],
        partyALegalPersonName: [
          { required: true, message: "甲方法定代表人不能为空", trigger: "blur" }
        ],
        // partyALegalPersonIdCardNo: [
        //   { required: true, message: "甲方法人身份证号不能为空", trigger: "blur" }
        // ],
        partyBName: [
          { required: true, message: "乙方姓名不能为空", trigger: "blur" }
        ],
        partyBLegalPersonName: [
          { required: true, message: "乙方法定代表人不能为空", trigger: "blur" }
        ],
        partyAContactPhone:[
          { required: true, message: "甲方联系电话格式不正确", trigger: "blur",validator: validatePhone }
        ],
        partyBContactPhone:[
          { required: true, message: "乙方联系电话格式不正确", trigger: "blur",validator: validatePhone}
        ],
        partyALegalPersonIdCardNo:[
          { required: false, message: "甲方法人身份证号格式不正确", trigger: "blur",validator: validateIdCard }
        ],
        partyBLegalPersonIdCardNo:[
          { required: false, message: "乙方法人身份证号格式不正确", trigger: "blur",validator: validateIdCard }
        ]
      }
    };
  },
  created() {
    this.tableHeight = window.innerHeight - 300 + "px";
    this.uploadHeaders = {'Authorization':'Bearer ' + getToken()};
    this.getList();
    // console.log("userInfo",this.userInfo)
    // 从vuex中拿用户信息
    let userName = this.$store.getters.name
    let userInfo = this.$store
    console.log("userInfo",userInfo)
    // this.form.createUser = userName;
    // console.log(this.form.createUser)
    console.log('name',this.name)
  
  },
  computed:{
            ...mapGetters([
                "name","permission","sysHireInfo","userRoles","dicAll","tagList"]),
  },
  watch: {
    "form.priceStandardUnitPriceLower":{
                handler(newValue,oldValue){
                 
                  this.form.priceStandardUnitPriceUpper = this.changeMoneyToCn(newValue)
                },
               
            },
    "form.priceStandardTotalPriceLower":{
            handler(newValue){
              this.form.priceStandardTotalPriceUpper = this.changeMoneyToCn(newValue)
            },
            
    },
    "form.price":{
      handler(newValue){
            this.form.priceStandardUnitPriceUpper = this.changeMoneyToCn(newValue)
        }
    },
    "form.payMethodSinglePriceLower":{
           handler(newValue){
             this.form.payMethodSinglePriceUpper = this.changeMoneyToCn(newValue)
           }
    },
    "form.payMethodInstallmentMonthLower":{
      handler(newValue){
        this.form.payMethodInstallmentMonthUpper = this.changeMoneyToCn(newValue)
      }
    },
    "form.payMethodInstallmentQuarterLower":{
      handler(newValue){
        this.form.payMethodInstallmentQuarterUpper = this.changeMoneyToCn(newValue)
      }
    },
    "form.payMethodInstallmentYearLower":{
      handler(newValue){
        this.form.payMethodInstallmentYearUpper = this.changeMoneyToCn(newValue)
      }
    },
  },
  methods: {
    //下载附件
    handleDowload(row,index){
      // download('/file/file/downloadContractFile/'+row.id,null,"测试.docx")
       downloadContractFile(row.id).then(response=>{
                    let blob = new Blob([response], {type: "application/octet-stream"});
                    console.log(response)
                    console.log(response.data)
                    console.log(blob)
                    let objectUrl = URL.createObjectURL(blob);
                    let link = document.createElement('a')
                    link.style.display = 'none'
                    link.href = objectUrl
                    // link.setAttribute('download', row.docName+'.'+row.fileType);
                    link.setAttribute('download', row.contractName+".docx");
                    document.body.appendChild(link)
                    link.click()
       })
      // let params = new URLSearchParams();
      //           let _self = this;
      //           params.append("id", row.id);
      //           axios({
      //               method: 'POST',
      //               url: 'http://localhost/dev-api/file/file/downloadContractFile/ffe53a250e3e48db918c4d19f30179d0x',
      //               data: params,
      //               responseType: 'blob'
      //           }).then((response) => {
      //               let blob = new Blob([response.data], {type: "application/octet-stream"});
      //               let objectUrl = URL.createObjectURL(blob);
      //               let link = document.createElement('a')
      //               link.style.display = 'none'
      //               link.href = objectUrl
      //               link.setAttribute('download', '试验.docx');
      //               document.body.appendChild(link)
      //               link.click()

      //           }).catch((error) => {
      //               console.log(error)
      //           })
    },
    //对附件大小的单位进行处理
    formatFileSize(sizeByte) {
        if (sizeByte === 0) return '0 KB';
        const sizeKB = sizeByte / 1024; // 转换公式
        return sizeKB.toFixed(2) + ' KB'; // 保留两位小数
    },
      // 上传前对文件的大小的判断
      beforeAvatarUpload(file) {

              var fileName = new Array()
              fileName = file.name.split('.');
              var lastName = fileName[fileName.length - 1];

              const isLt2M = file.size / 1024 / 1024 < 20  
              if (lastName == "exe" || lastName == "EXE") {
                  this.$message({
                      message: '不能上传可执行文件',
                      type: 'warning'
                  });
              }
              if (!isLt2M) {
                  this.$message({
                      message: '上传模板大小不能超过 20M',
                      type: 'warning'
                  });
              }

              return !(lastName == "exe" || lastName == "EXE") && isLt2M;
      },
    uploadSuccess() {
                this.$refs['upload'].clearFiles();
                // this.mainLoading=false;
                this.$message({
                    showClose: true,
                    message: "上传成功",
                    type: "success"
                });
                this.formUpload.name = "";
                this.uploadShow = false;
                // this.handleQueryDoc();

            },
    submitUpload(){
                if(this.formUpload.name == null ||this.formUpload.name == ""){
                    this.$message({
                        message: '制度标题不能为空',
                        type: 'warning'
                    });
                    return false;
                }
                this.uploadData.contractName = this.formUpload.name;
                this.uploadData.contractNo = this.info.contractNo
                this.mainLoading=true;
                this.$refs.upload.submit();
                let _self = this;
                //刷新附件列表
                setTimeout(()=>{
                  getContractFile(this.info.contractNo).then(response =>{
                      _self.fileData = response.data;
                      console.log('fileData',_self.fileData)
                      _self.mainLoading=false;
                    })
                },700)
               
    },
    addContact(){
        // alert('打开合同上传窗口')
        this.uploadShow = true
    },
  // 写一个函数，将阿拉伯数字形式的金额转化为汉字大写lyf
    changeMoneyToCn(money){
                // 接收数字或者字符串数字
              if (typeof money === "string") {
                if (money === '') return ''
                if (isNaN(parseFloat(money))) {
                  throw Error(`参数有误：${money}，请输入数字或字符串数字`)
                } else {
                  // 去掉分隔符(,)
                  money = money.replace(/,/g, '')
                }
              } else if (typeof money === "number") {
                // 去掉分隔符(,)
                money = money.toString().replace(/,/g, '')
              } else {
                throw Error(`参数有误：${money}，请输入数字或字符串数字`)
              }
              // 汉字的数字
              const cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'] 
              // 基本单位
              const cnIntRadice = ['', '拾', '佰', '仟'] 
              // 对应整数部分扩展单位
              const cnIntUnits = ['', '万', '亿', '兆'] 
              // 对应小数部分单位
              const cnDecUnits = ['角', '分', '毫', '厘']
              // 整数金额时后面跟的字符
              const cnInteger = '整' 
              // 整型完以后的单位
              const cnIntLast = '元' 
              // 金额整数部分
              let IntegerNum 
              // 金额小数部分
              let DecimalNum 
              // 输出的中文金额字符串
              let ChineseStr = '' 
              // 正负值标记
              let Symbol = '' 
              // 转成浮点数
              money = parseFloat(money)
              // 如果是0直接返回结果
              if (money === 0) {
                ChineseStr = cnNums[0] + cnIntLast + cnInteger
                return ChineseStr
              }
              // 如果小于0，则将Symbol标记为负，并转为正数
              if (money < 0) {
                money = -money
                Symbol = '负 '
              }
              // 转换为字符串
              money = money.toString()
              // 将整数部分和小数部分分别存入IntegerNum和DecimalNum
              if (money.indexOf('.') === -1) {
                IntegerNum = money
                DecimalNum = ''
              } else {
                const moneyArr = money.split('.')
                IntegerNum = moneyArr[0]
                DecimalNum = moneyArr[1].substr(0, 4)
              }
              // 获取整型部分转换
              if (parseInt(IntegerNum, 10) > 0) {
                let zeroCount = 0
                let IntLen = IntegerNum.length
                for (let i = 0; i < IntLen; i++) {
                  // 获取整数的每一项
                  let term = IntegerNum.substr(i, 1)
                  // 剩余待处理的数量
                  let surplus = IntLen - i - 1
                  // 用于获取整数部分的扩展单位
                  // 剩余数量除以4，比如12345，term为1时，expandUnit则为1，
                  // cnIntUnits[expandUnit]对应得到的单位为万
                  let expandUnit = surplus / 4
                  // 用于获取整数部分的基本单位
                  // 剩余数量取余4，比如123，那么第一遍遍历term为1，surplus为2，baseUnit则为2，
                  // 所以cnIntRadice[baseUnit]对应得到的基本单位为'佰'
                  let baseUnit = surplus % 4
                  if (term === '0') {
                    zeroCount++
                  } else {
                    // 连续存在多个0的时候需要补'零'
                    if (zeroCount > 0) {
                      ChineseStr += cnNums[0]
                    }
                    // 归零
                    zeroCount = 0
                    /* 
                    cnNums是汉字的零到玖组成的数组，term则是阿拉伯0-9，
                    直接将阿拉伯数字作为下标获取中文数字
                    例如term是0则cnNums[parseInt(term)]取的就是'零'，9取的就是'玖'
                    最后加上单位就转换成功了！
                    这里只加十百千的单位
                    */
                    ChineseStr += cnNums[parseInt(term)] + cnIntRadice[baseUnit]
                  }
                  /*
                    如果baseUnit为0，意味着当前项和下一项隔了一个节权位即隔了一个逗号
                    扩展单位只有大单位进阶才需要，判断是否大单位进阶，则通过zeroCount判断
                    baseUnit === 0即存在逗号，baseUnit === 0 && zeroCount < 4 意为大单位进阶
                  */
                  if (baseUnit === 0 && zeroCount < 4) {
                    ChineseStr += cnIntUnits[expandUnit]
                  }
                }
                ChineseStr += cnIntLast
              }
              // 小数部分转换
              if (DecimalNum !== '') {
                let decLen = DecimalNum.length
                for (let i = 0; i < decLen; i++) {
                  // 同理，参考整数部分
                  let term = DecimalNum.substr(i, 1)
                  if (term !== '0') {
                    ChineseStr += cnNums[Number(term)] + cnDecUnits[i]
                  }
                }
              }
              ChineseStr = Symbol + ChineseStr
              console.log(ChineseStr)
              return ChineseStr
      
      
    
    },

    validateIdCardNo(value){
      // 用正则表达式校验身份证号
      var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
      if(reg.test(value)){
        return true;
      }else{
        return false;
      }

    },
    validatePhoneNo(value){
      var reg = /^1[3|4|5|7|8][0-9]{9}$/;
      if(reg.test(value)){
        return true;
      }else{
        return false;
      }
    },
    /** 查询contract列表 */
    getList() {
      this.loading = true;
      listContract(this.queryParams).then(response => {
        this.contractList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        contractName: null,
        contractType: null,
        orgId: null,
        partyAName: null,
        partyASocialCreditCode: null,
        partyAIdCardNo: null,
        partyALegalPersonName: null,
        partyALegalPersonIdCardNo: null,
        partyAContactAddress: null,
        partyAContactPhone: null,
        partyAManageType: null,
        partyBName: null,
        partyBSocialCreditCode: null,
        partyBIdCardNo: null,
        partyBLegalPersonName: null,
        partyBLegalPersonIdCardNo: null,
        partyBContactAddress: null,
        partyBContactPhone: null,
        partyBManageType: null,
        landPurpose: null,
        landCirculationPrice: null,
        landCirculationType: null,
        landCirculationTerm: null,
        landCirculationAmount: null,
        startTime: null,
        endTime: null,
        landCounty: null,
        landStreet: null,
        landVillage: null,
        landGroup: null,
        createUser: null,
        createTime: null,
        deliveryTime: null,
        partyASignName: null,
        partyASignTime: null,
        partyASignPlace: null,
        partyBSignName: null,
        partyBSignTime: null,
        partyBSignPlace: null,
        landEastBorder: null,
        landWestBorder: null,
        landSouthBorder: null,
        landNorthBorder: null,
        priceStandardUnitPriceLower: null,
        priceStandardUnitPriceUpper: null,
        priceStandardTotalPriceLower: null,
        priceStandardTotalPriceUpper: null,
        priceStandardOther: null,
        priceStandardOtherAdjustCycle: null,
        priceStandardOthreAdjustWay: null,
        payMethodSingleTerm: null,
        payMethodSinglePriceLower: null,
        payMethodSinglePriceUpper: null,
        payMethodInstallmentMonthLower: null,
        payMethodInstallmentMonthUpper: null,
        payMethodInstallmentMonthTime: null,
        payMethodInstallmentQuarterLower: null,
        payMethodInstallmentQuarterUpper: null,
        payMethodInstallmentQuarterTime: null,
        payMethodInstallmentYearLower: null,
        payMethodInstallmentYearUpper: null,
        payMethodInstallmentYearTime: null,
        payMethodOther: null,
        payWayIsCash: null,
        payWayBankCardName: null,
        payWayBankCardId: null,
        payWayBankOpeningBank: null,
        payWayOther: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      // this.reset();
      this.open = true;
      this.title = "新增合同";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getContract(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改contract";
      });
    },
    /** 查看按钮操作 */
    handleView(row){
        //  alert(row.contractNo)
         this.drawerShow = true;
         //vae
         getContractFile(row.contractNo).then(response =>{
             this.fileData = response.data;
         })

         getContract(row.id).then(response => {
           this.info = response.data;
           if(this.info.payMethodInstallmentMonthLower != null){
              this.info.payMethodCycle = '1';
           }
           if(this.info.payMethodInstallmentQuarterLower != null){
              this.info.payMethodCycle = '2';
           }
           if(this.info.payMethodInstallmentYearLower != null){
              this.info.payMethodCycle = '3';
           }
          
           

         });
    },

    /** 预览pdf */ 
    handleViewPDF(row,index){
      // alert('预览pdf'+row.id)
      // let viewPath = baseUrl + row.viewPath.substring(1, row.viewPath.length);
      // let viewPath = 'http://localhost/dev-api/file/file/previewPDF/' + row.viewPath.substring(0, row.viewPath.length);
      let viewPath = 'http://localhost/dev-api/file/file/previewPDF/' + row.viewPath;
      window.open(viewPath);

    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
           
            updateContract(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
             //创建人直接从vuex中获取
             let userName = this.$store.getters.name
            this.form.createUser = userName;
            addContract(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除contract编号为"' + ids + '"的数据项？').then(function() {
        return delContract(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('contract/contract/export', {
        ...this.queryParams
      }, `contract_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>

<style lang="scss" scoped>
    .inner {
      background-color: #F5F7FA;
      color:black;
    }
    table, th, td {  
      border: 0.5px solid #999; /* 这将设置边框的宽度、样式和颜色 */  
    }
    .upperPrice {
      margin-left: 20px;
      color:blue
    }
    .row-bg {
      height: 45px;
      line-height: 45px;
    } 

    //写在scoped内
//输入框
::v-deep .el-input.is-disabled .el-input__inner{
    // height: 34px;
    // background: #2E4074;
    // border-radius: 2px;
    // border: 1px solid #435FAC;
    color: black;
}

//单选框
::v-deep .el-radio.is-disabled .el-radio__label{
    // height: 34px;
    // background: #2E4074;
    // border-radius: 2px;
    // border: 1px solid #435FAC;
    color: black;
}
//文本框
::v-deep .el-textarea.is-disabled .el-textarea__inner{
    height: 34px;
    background: #2E4074;
    border-radius: 2px;
    border: 1px solid #435FAC;
    width: 100%;
}

</style>